package com.itheima.shop.decorator_review;

import com.itheima.shop.domain.Order;
import org.springframework.stereotype.Component;

/**
 * @program: design
 * @description:
 * @author: zhanghz001
 * @create: 2021-02-27 15:51
 **/
@Component
public class FullMoneySumReview extends DecoratorReview {
    @Override
    public void sum(Order order) {
        super.sum(order);
        moneySum(order);
    }
    
    private void moneySum(Order order) {
        Integer paymoney = order.getPaymoney();
        if (paymoney >= 100) {
            order.setPaymoney(paymoney - 10);
        }
    }
}
